﻿using System;
using System.Data;
using System.Collections.Generic;
using EnterpriseFund.Model;
namespace EnterpriseFund.BLL
{
    /// <summary>
    /// AllowanceIssue
    /// </summary>
    public partial class AllowanceIssue
    {
        private readonly EnterpriseFund.DAL.AllowanceIssue dal = new EnterpriseFund.DAL.AllowanceIssue();
        public AllowanceIssue()
        { }
        #region  BasicMethod
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(EnterpriseFund.Model.AllowanceIssue model)
        {
            dal.Add(model);
        }

                  /// <summary>
        /// 确定旗号
        /// </summary>
        /// <param name="modelList"></param>
        /// <param name="issueID"></param>
        public void IssueAudit(string issueID)
        {
            dal.IssueAudit(issueID);
        }

               /// <summary>
        /// 确定旗号
        /// </summary>
        /// <param name="modelList"></param>
        /// <param name="issueID"></param>
        public void IssueAuditALL(string allowanceFileEntryID)
        {
            dal.IssueAuditALL(allowanceFileEntryID);
        }

                /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public EnterpriseFund.Model.AllowanceIssue GetLastModel()
        {
            return dal.GetLastModel();
        }

        
        /// <summary>
        /// 获得当前年度的最大单号
        /// </summary>
        public string GetMaxNo(string allowanceClassNo, string year)
        {
            return dal.GetMaxNo(allowanceClassNo, year);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(string FIssueID)
        {

            return dal.Delete(FIssueID);
        }
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool DeleteList(string FIssueIDlist)
        {
            return dal.DeleteList(FIssueIDlist);
        }

              /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public EnterpriseFund.Model.AllowanceIssue GetModelByIssueNo(string FIssueNo)
        {
            return dal.GetModelByFIssueNo(FIssueNo);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public EnterpriseFund.Model.AllowanceIssue GetModel(string FIssueID)
        {

            return dal.GetModel(FIssueID);
        }

        
        /// <summary>
        /// 得到一个对象实体(FStatus<>'3')
        /// </summary>
        public EnterpriseFund.Model.AllowanceIssue GetModelByFIssueID(string FIssueID)
        {
            return dal.GetModelByFIssueID(FIssueID);
        }

                /// <summary>
        /// 确定旗号
        /// </summary>
        /// <param name="modelList"></param>
        /// <param name="issueID"></param>
        public void IssueToOK(string issueID, List<Model.AllowanceIssueEntry> modelList)
        {
            dal.IssueToOK(issueID, modelList);
        }

                    /// <summary>
        /// 确定旗号
        /// </summary>
        /// <param name="modelList"></param>
        /// <param name="issueID"></param>
        public void IssueToOKPortion(List<Model.AllowanceIssueEntry> modelList)
        {
            dal.IssueToOKPortion(modelList);
        }

             /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public EnterpriseFund.Model.AllowanceIssue GetModelByFIssueNo(string FIssueNo)
        {
            return dal.GetModelByFIssueNo(FIssueNo);
        }



        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            return dal.GetList(Top, strWhere, filedOrder);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<EnterpriseFund.Model.AllowanceIssue> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<EnterpriseFund.Model.AllowanceIssue> DataTableToList(DataTable dt)
        {
            List<EnterpriseFund.Model.AllowanceIssue> modelList = new List<EnterpriseFund.Model.AllowanceIssue>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                EnterpriseFund.Model.AllowanceIssue model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = dal.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }
            /// <summary>
        /// 获取记录总数
        /// </summary>
        public int GetRecordCount2(string strWhere)
        {
            return dal.GetRecordCount2(strWhere);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public int GetRecordCount(string strWhere)
        {
            return dal.GetRecordCount(strWhere);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
        {
            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod
        #region  ExtensionMethod

        #endregion  ExtensionMethod
    }
}

